/**
 * 其它设置页面
 */
import { FC } from "react";
import { observer, inject } from "mobx-react";
import { Typography, Divider, Button } from "antd";
import { SyncOutlined } from "@ant-design/icons";
import { ITStore } from "../../store";

const { Title } = Typography;

type TProp = {
  store: ITStore;
};
const Baseset: FC<TProp | any> = ({ store }: TProp): JSX.Element => {
  const {
    languageStore: { lang },
  } = store;

  const clearCache = () => {
    localStorage.removeItem("language");
    localStorage.removeItem("dict");
  };

  return (
    <Typography>
      <Title level={3}>{lang["langdatabackup"]}</Title>
      <Divider orientation="left" orientationMargin={0}></Divider>
      <Button type="primary" onClick={clearCache} icon={<SyncOutlined />}>
        {lang["langclearcache"]}
      </Button>
    </Typography>
  );
};

export default inject("store")(observer(Baseset));
